﻿using System.Collections;
using System.Collections.Generic;
using LuaFramework;
using UnityEngine;

/// <summary>
/// 和服务器网络连接 数据传输
/// </summary>
public class LoginNetHandler : Singleton<LoginNetHandler> {



    #region 注册
    public void SentToServerRegistAccountRequest(int MsgId, UserAccountInfo registAccountInfo)
    {
        //发送给服务器
        //OnReceiveServerBackRegistAccountResponse(MsgId, registAccountInfo);
    }
    /// <summary>
    /// 服务器发送回 注册结果  result有信息:注册成功  null: 注册失败
    /// </summary>
    /// <param name="MsgId"></param>
    /// <param name="result"></param>
    public void OnReceiveServerBackRegistAccountResponse(int MsgId, UserAccountInfo result)
    {
        //服务器回传数据暂存manager中
        LoginManger.instance.OnReceiveServerBackRegistAccountResponse(result);
    }
    #endregion


    #region 登录
    public void SentToServerLoginAccountRequest(int MsgId, UserAccountInfo registAccountInfo)
    {
        //发送给服务器
        //OnReceiveServerBackRegistAccountResponse(MsgId, registAccountInfo);
    }


    public void OnReceiveServerBackLoginAccountResponse(int MsgId, bool result)
    {
        //服务器回传数据暂存manager中
        LoginManger.instance.OnReceiveServerBackLoginAccountResponse(result);
    }
    #endregion

    #region 创建角色

    public void SentToServerCrateRoleNameSuccess(string data)
    {
        
    }

    #endregion

}
